<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content=
    "application/xhtml+xml; charset=iso-8859-1" />
    <title>
      btrfs-progs-5.4.1
    </title>
    <link rel="stylesheet" type="text/css" href="../stylesheets/lfs.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="stylesheet" href="../stylesheets/lfs-print.css" type=
    "text/css" media="print" />
  </head>
  <body class="blfs" id="blfs-2020-04-02">
    <div class="navheader">
      <h4>
        Beyond Linux<sup>�</sup> From Scratch <span class="phrase">(System
        V</span> Edition) - Version 2020-04-02
      </h4>
      <h3>
        Chapter&nbsp;5.&nbsp;File Systems and Disk Management
      </h3>
      <ul>
        <li class="prev">
          <a accesskey="p" href="initramfs.html" title=
          "About initramfs">Prev</a>
          <p>
            About initramfs
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="dosfstools.html" title=
          "dosfstools-4.1">Next</a>
          <p>
            dosfstools-4.1
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="filesystems.html" title=
          "Chapter&nbsp;5.&nbsp;File Systems and Disk Management">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Beyond Linux� From Scratch     (System V Edition) - Version 2020-04-02">
          Home</a>
        </li>
      </ul>
    </div>
    <div class="sect1" lang="en" xml:lang="en">
      <h1 class="sect1">
        <a id="btrfs-progs" name="btrfs-progs"></a>btrfs-progs-5.4.1
      </h1>
      <div class="package" lang="en" xml:lang="en">
        <h2 class="sect2">
          Introduction to btrfs-progs
        </h2>
        <p>
          The <span class="application">btrfs-progs</span> package contains
          administration and debugging tools for the B-tree file system
          (btrfs).
        </p>
        <p>
          This package is known to build and work properly using an LFS-9.1
          platform.
        </p>
        <h3>
          Package Information
        </h3>
        <div class="itemizedlist">
          <ul class="compact">
            <li class="listitem">
              <p>
                Download (HTTP): <a class="ulink" href=
                "https://www.kernel.org/pub/linux/kernel/people/kdave/btrfs-progs/btrfs-progs-v5.4.1.tar.xz">
                https://www.kernel.org/pub/linux/kernel/people/kdave/btrfs-progs/btrfs-progs-v5.4.1.tar.xz</a>
              </p>
            </li>
            <li class="listitem">
              <p>
                Download MD5 sum: 4fb3ac57dc4e0afcf723cdf34640179b
              </p>
            </li>
            <li class="listitem">
              <p>
                Download size: 2.0 MB
              </p>
            </li>
            <li class="listitem">
              <p>
                Estimated disk space required: 62 MB (add 71 MB for tests)
              </p>
            </li>
            <li class="listitem">
              <p>
                Estimated build time: 0.2 SBU (add 15 SBU for tests)
              </p>
            </li>
          </ul>
        </div>
        <h3>
          Btrfs-progs Dependencies
        </h3>
        <h4>
          Required
        </h4>
        <p class="required">
          <a class="xref" href="../general/lzo.html" title=
          "LZO-2.10">LZO-2.10</a>
        </p>
        <h4>
          Recommended
        </h4>
        <p class="recommended">
          <a class="xref" href="../general/asciidoc.html" title=
          "Asciidoc-8.6.9">asciidoc-8.6.9</a> and <a class="xref" href=
          "../pst/xmlto.html" title="xmlto-0.0.28">xmlto-0.0.28</a> (both
          required to generate man pages)
        </p>
        <h4>
          Optional
        </h4>
        <p class="optional">
          <a class="xref" href="lvm2.html" title=
          "LVM2-2.03.09">LVM2-2.03.09</a> (<span class=
          "command"><strong>dmsetup</strong></span> is used in tests),
          <a class="xref" href="../general/python2.html" title=
          "Python-2.7.17">Python-2.7.17</a> (python bindings), and <a class=
          "xref" href="reiserfs.html" title=
          "reiserfsprogs-3.6.27">reiserfsprogs-3.6.27</a> (for tests)
        </p>
        <p class="usernotes">
          User Notes: <a class="ulink" href=
          "http://wiki.linuxfromscratch.org/blfs/wiki/xfs">http://wiki.linuxfromscratch.org/blfs/wiki/xfs</a>
        </p>
      </div>
      <div class="kernel" lang="en" xml:lang="en">
        <h2 class="sect2">
          <a id="btrfs-progs-kernel" name="btrfs-progs-kernel"></a>Kernel
          Configuration
        </h2>
        <p>
          Enable the following option in the kernel configuration and
          recompile the kernel:
        </p>
        <pre class="screen">
<code class="literal">File systems ---&gt;
  &lt;*/M&gt; Btrfs filesystem support [CONFIG_BTRFS_FS]</code>
</pre>
        <div class="admon note">
          <img alt="[Note]" src="../images/note.png" />
          <h3>
            Note
          </h3>
          <p>
            CONFIG_BTRFS_FS_POSIX_ACL and CONFIG_REISERFS_FS_XATTR are
            required for some tests. Other Btrfs options in the kernel are
            optional.
          </p>
        </div>
      </div>
      <div class="installation" lang="en" xml:lang="en">
        <h2 class="sect2">
          Installation of btrfs-progs
        </h2>
        <p>
          Install <span class="application">btrfs-progs</span> by running the
          following commands:
        </p>
        <pre class="userinput">
<kbd class="command">./configure --prefix=/usr  \
            --bindir=/bin  \
            --libdir=/lib  \
            --disable-zstd &amp;&amp;
make</kbd>
</pre>
        <div class="admon note">
          <img alt="[Note]" src="../images/note.png" />
          <h3>
            Note
          </h3>
          <p>
            Some tests require grep built with perl regular expressions. To
            obtain this, rebuild grep with the LFS Chapter 6 instructions
            after installing <a class="xref" href="../general/pcre.html"
            title="PCRE-8.44">PCRE-8.44</a>.
          </p>
        </div>
        <p>
          Before running tests, build a support program and disable several
          that fail:
        </p>
        <pre class="userinput">
<kbd class="command">make fssum &amp;&amp;

sed -i '/found/s/^/: #/' tests/convert-tests.sh &amp;&amp;

mv tests/convert-tests/010-reiserfs-basic/test.sh{,.broken}                 &amp;&amp;
mv tests/convert-tests/011-reiserfs-delete-all-rollback/test.sh{,.broken}   &amp;&amp;
mv tests/convert-tests/012-reiserfs-large-hole-extent/test.sh{,.broken}     &amp;&amp;
mv tests/convert-tests/013-reiserfs-common-inode-flags/test.sh{,.broken}    &amp;&amp;
mv tests/convert-tests/014-reiserfs-tail-handling/test.sh{,.broken}         &amp;&amp;
mv tests/misc-tests/025-zstd-compression/test.sh{,.broken}</kbd>
</pre>
        <p>
          To test the results, issue (as the <code class=
          "systemitem">root</code> user):
        </p>
        <pre class="root">
<kbd class="command">pushd tests
   ./fsck-tests.sh    
   ./mkfs-tests.sh    
   ./cli-tests.sh     
   ./convert-tests.sh 
   ./misc-tests.sh    
   ./fuzz-tests.sh    
popd</kbd>
</pre>
        <p>
          Install the package as the <code class="systemitem">root</code>
          user:
        </p>
        <pre class="root">
<kbd class="command">make install &amp;&amp;

ln -sfv ../../lib/$(readlink /lib/libbtrfs.so) /usr/lib/libbtrfs.so &amp;&amp;
ln -sfv ../../lib/$(readlink /lib/libbtrfsutil.so) /usr/lib/libbtrfsutil.so &amp;&amp;
rm -fv /lib/libbtrfs.{a,so} /lib/libbtrfsutil.{a,so} &amp;&amp;
mv -v /bin/{mkfs,fsck}.btrfs /sbin</kbd>
</pre>
      </div>
      <div class="commands" lang="en" xml:lang="en">
        <h2 class="sect2">
          Command Explanations
        </h2>
        <p>
          <code class="option">--disable-documentation</code>: This option is
          needed if the recommended dependencies are not installed.
        </p>
        <p>
          <span class="command"><strong>mv
          tests/{cli,convert,misc,fuzz}-tests/ ...</strong></span>: Disables
          tests that fail and prevent tests from completing.
        </p>
        <p>
          <span class="command"><strong>ln -s ...
          /usr/lib/libbtrfs.so</strong></span>: Creates a symbolic link in
          the directory where it is expected.
        </p>
        <p>
          <span class="command"><strong>rm
          /lib/libbtrfs.{a,so}</strong></span>: Removes unneeded library
          entries.
        </p>
      </div>
      <div class="content" lang="en" xml:lang="en">
        <h2 class="sect2">
          Contents
        </h2>
        <div class="segmentedlist">
          <div class="seglistitem">
            <div class="seg">
              <strong class="segtitle">Installed Programs:</strong>
              <span class="segbody">btrfs, btrfs-convert, btrfs-find-root,
              btrfs-image, btrfs-map-logical, btrfs-select-super, btrfsck
              (link to btrfs), btrfstune, fsck.btrfs, and mkfs.btrfs</span>
            </div>
            <div class="seg">
              <strong class="segtitle">Installed Libraries:</strong>
              <span class="segbody">libbtrfs.so and libbtrfsutil.so</span>
            </div>
            <div class="seg">
              <strong class="segtitle">Installed Directories:</strong>
              <span class="segbody">/usr/include/btrfs</span>
            </div>
          </div>
        </div>
        <div class="variablelist">
          <h3>
            Short Descriptions
          </h3>
          <table border="0" class="variablelist">
            <colgroup>
              <col align="left" valign="top" />
              <col />
            </colgroup>
            <tbody>
              <tr>
                <td>
                  <p>
                    <a id="btrfs-prog" name="btrfs-prog"></a><span class=
                    "term"><span class=
                    "command"><strong>btrfs</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is the main interface into btrfs filesystem operations.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="btrfs-convert" name=
                    "btrfs-convert"></a><span class="term"><span class=
                    "command"><strong>btrfs-convert</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    converts from an ext2/3/4 filesystem to btrfs.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="btrfs-find-root" name=
                    "btrfs-find-root"></a><span class="term"><span class=
                    "command"><strong>btrfs-find-root</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is a filter to find btrfs root.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="btrfs-map-logical" name=
                    "btrfs-map-logical"></a><span class="term"><span class=
                    "command"><strong>btrfs-map-logical</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    maps btrfs logical extent to physical extent.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="btrfs-select-super" name=
                    "btrfs-select-super"></a><span class="term"><span class=
                    "command"><strong>btrfs-select-super</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    overwrites the primary superblock with a backup copy.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="btrfstune" name="btrfstune"></a><span class=
                    "term"><span class=
                    "command"><strong>btrfstune</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    tunes various filesystem parameters.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="fsck.btrfs" name="fsck.btrfs"></a><span class=
                    "term"><span class=
                    "command"><strong>fsck.btrfs</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    does nothing, but is present for consistency with fstab.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="mkfs.btrfs" name="mkfs.btrfs"></a><span class=
                    "term"><span class=
                    "command"><strong>mkfs.btrfs</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    creates a btrfs file system.
                  </p>
                </td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
      <p class="updated">
        Last updated on 2020-03-25 16:46:27 -0500
      </p>
    </div>
    <div class="navfooter">
      <ul>
        <li class="prev">
          <a accesskey="p" href="initramfs.html" title=
          "About initramfs">Prev</a>
          <p>
            About initramfs
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="dosfstools.html" title=
          "dosfstools-4.1">Next</a>
          <p>
            dosfstools-4.1
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="filesystems.html" title=
          "Chapter&nbsp;5.&nbsp;File Systems and Disk Management">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Beyond Linux� From Scratch     (System V Edition) - Version 2020-04-02">
          Home</a>
        </li>
      </ul>
    </div>
  </body>
</html>
